<script setup lang="js">
	// 窗体的状态，最大化or最小化
	const isMaximized = ref(false)
	/**
	 * 最小化 窗体
	 */
	const onWindowMin = () => {
		window.AIOSys.ipcRenderer.send('onWindowMin')
	}

	/**
	 * 最大化 窗体
	 */
	const onWindowMax = () => {
		window.AIOSys.ipcRenderer.invoke('onWindowMax').then((data) => {
			isMaximized.value = data
		})
	}

	/**
	 * 退出程序
	 */
	const onAppQuit = () => {
		window.AIOSys.ipcRenderer.send('onAppQuit', false)
	}
</script>
<template>
	<div>
		<div class="main">
			<div class="logoBanner">爱零校区管理系统</div>
			<div class="sys_bar">
				<div @click="onWindowMin" class="NO_DRAG">
					<el-icon>
						<SemiSelect />
					</el-icon>
				</div>

				<div @click="onWindowMax" class="NO_DRAG">
					<el-icon v-if="isMaximized == false"
						><Monitor />
					</el-icon>
					<el-icon v-if="isMaximized"
						><CopyDocument
					/></el-icon>
				</div>

				<div @click="onAppQuit" class="NO_DRAG">
					<el-icon><Close /></el-icon>
				</div>
			</div>
		</div>
	</div>
</template>
<style scoped lang="css">
	div {
		height: 100%;
	}
	.main {
		width: 100vw;
		height: 100%;
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		align-items: center;
	}
	.sys_bar {
		height: 100%;
		display: flex;
		justify-content: flex-end;
		justify-items: center;
		align-items: center;
		margin-right: 10px;
	}
	.sys_bar > div {
		width: 35px;
		height: 35px;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.logoBanner {
		font-size: 1.6em;
		line-height: 2.4em;
		text-align: center;
		padding: 1vw;
		color: #67c23a;
	}
</style>
